﻿@model S4Store.Models.Inventory.HistoryModel
@{
    Layout = null;
    ViewBag.Title = "Customer";
    
    S4Store.Models.Chart.Line ChartModel = new S4Store.Models.Chart.Line();
    ChartModel.Name = "库存总数";
    ChartModel.YAxis = "库存总数";
    foreach(var m in Model.Reports){
        ChartModel.XAxis.Add(m.Month + "月");
    }
    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标库存";
    foreach(var m in Model.Reports){
        series1.Data.Add(m.GiveCarCount);
    }
    ChartModel.Serieses.Add(series1);

    S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际库存";
    foreach (var m in Model.Reports)
    {
        series2.Data.Add(m.Inventory);
    }
    ChartModel.IsRate = false;
    ChartModel.Serieses.Add(series2);
    ChartModel.Colors = new List<string> { S4Store.Models.Chart.Color.Green, S4Store.Models.Chart.Color.Blue };



    S4Store.Models.Chart.Line ChartModel2 = new S4Store.Models.Chart.Line();
    ChartModel2.Name = "总库存系数";
    ChartModel2.YAxis = "总库存系数";
    foreach (var m in Model.Reports)
    {
        ChartModel2.XAxis.Add(m.Month + "月");
    }
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标库存系数";
    foreach (var m in Model.Reports)
    {
        series1.Data.Add(m.CarKpiMonthConfig.InventoryIndexTarget);
    }
    ChartModel2.Serieses.Add(series1);

    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际库存系数";
    foreach (var m in Model.Reports)
    {
        series2.Data.Add(m.InventoryCoefficient);
    }
    ChartModel2.IsRate = false;
    ChartModel2.Serieses.Add(series2);
    ChartModel2.Colors = new List<string> { S4Store.Models.Chart.Color.Green, S4Store.Models.Chart.Color.Blue };



    S4Store.Models.Chart.Line ChartModel3 = new S4Store.Models.Chart.Line();
    ChartModel3.Name = "库存结构";
    ChartModel3.YAxis = "库存结构";
    foreach (var m in Model.Reports)
    {
        ChartModel3.XAxis.Add(m.Month+"月");
    }
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "A类库存";
    foreach (var m in Model.Reports)
    {
        series1.Data.Add(m.AKC);
    }

    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "B类库存";
    foreach (var m in Model.Reports)
    {
        series2.Data.Add(m.BKC);
    }


    S4Store.Models.Chart.ChartSeries series3 = new S4Store.Models.Chart.ChartSeries();
    series3.Name = "C类库存";
    foreach (var m in Model.Reports)
    {
        series3.Data.Add(m.CKC);
    }



    S4Store.Models.Chart.ChartSeries series4 = new S4Store.Models.Chart.ChartSeries();
    series4.Name = "在途";
    foreach (var m in Model.Reports)
    {
        series4.Data.Add(m.ZT);
    }
    
    ChartModel3.IsRate = false;
    ChartModel3.Serieses.Add(series1);
    ChartModel3.Serieses.Add(series2);
    ChartModel3.Serieses.Add(series3);
    ChartModel3.Serieses.Add(series4);


}
<div style="height:100%; overflow:auto">

@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%">
<div class="tabs" currentIndex="0" eventType="click">
	<div class="tabsHeader">
		<div class="tabsHeaderContent">
			<ul>
				<li><a href="javascript:;"><span>库存总数</span></a></li>
				<li><a href="javascript:;"><span>总库存系数</span></a></li>
				<li><a href="javascript:;"><span>库存结构</span></a></li>
			</ul>
		</div>
	</div>
	<div class="tabsContent" >
		<div>
      @Html.Partial("../Chart/Line", ChartModel)
		</div>
		<div>
        @Html.Partial("../Chart/Line", ChartModel2)
		</div>
		<div>
        @Html.Partial("../Chart/Line", ChartModel3)
		</div>
	</div>
	<div class="tabsFooter">
		<div class="tabsFooterContent"></div>
	</div>
</div>
        
        
    
</div>
</div>



